<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>后台登录</title>
        <meta name="renderer" content="webkit">	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<!-- load css -->
	<link rel="stylesheet" type="text/css" href="/bsc/static/common/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/bsc/static/css/login.css" media="all">
    </head>
    <body>
<div class="layui-canvs"></div>

<div id="log" class="layui-layout layui-layout-login">
	<h1>
		 <strong>美研社管理系统后台</strong>
		 <em>Management System</em>
	</h1>
	<form action="" method="post">
	<div class="layui-user-icon larry-login">
		 <input type="text" placeholder="账号" class="login_txtbx" name="account" id="account"/>
	</div>
	<div class="layui-pwd-icon larry-login">
		 <input type="password" placeholder="密码" class="login_txtbx" name="password" id="password"/>
	</div>
	<div >
		 <a href="#" onclick="resetpwd()" style="position: relative;left: 280px" ><font color="blue">忘记密码？</font> </a>
	</div>
    <div class="layui-submit larry-login">
    	<input type="button" value="立即登陆" class="submit_btn" onclick="up()"/>
    </div>
    </form>
    <div class="layui-login-text">
    	<p>© 2018-2019 Larry 版权所有</p>
        <p>湖北襄阳</p>
    </div>
</div>
     <!--  重置密码  -->
<!-- <div id="up" class="layui-layout layui-layout-login" style="display: none;">
    <h1>
		 <em>填写以下信息重置密码为（123）</em>
	</h1>
	<div class="layui-user-icon larry-login">
		 <input type="text" placeholder="账号" class="login_txtbx" name="name" id="name"/>
	</div>
	<div class="layui-pwd-icon larry-login">
		 <input type="text" placeholder="身份证号" class="login_txtbx" name="idno" id="idno"/>
	</div>
	<div class="layui-submit larry-login">
    	<input type="button" value="提交" class="submit_btn" onclick="subpwd()"/>
    </div>
    <div class="layui-submit larry-login">
    	<input onclick="returnlog()" type="button" value="返回" class="submit_btn" onclick=""/>
    </div>
</div> -->
<script type="text/javascript" src="/bsc/static/common/layui/lay/dest/layui.all.js"></script>
<script type="text/javascript" src="/bsc/static/js/login.js"></script>
<script type="text/javascript" src="/bsc/static/jsplug/jparticle.jquery.js"></script>
<script type="text/javascript">
$(function(){
	$(".layui-canvs").jParticle({
		background: "#141414",
		color: "#E6E6E6"
	});
});
  function up(){
	 var account= $("#account").val();
	 var password=$("#password").val();
	 if(account=="" ){
		 alert("帐户名不能为空"); 
	 }else if(password==""){
		 alert("密码不能为空");  
	 }else {
		 document.forms[0].action="/bsc/user/login";
		 document.forms[0].submit();
		 
			/* $.ajax({
					type:"post",
					url:"/bsc/user/login",
					data:{"account":$("#account").val(),"password":$("#password").val()},
					success:function(msg){
					  location.href="/bsc/user/main";	
					}
				}); */
	 }
	
  }
  /*  显示和隐藏  */
  function resetpwd(){
	  $("#log").attr("style","display: none;");
	  $("#up").attr("style","");
  }
  function returnlog(){
	  $("#up").attr("style","display: none;");
	  $("#log").attr("style","");
  }
  /* 重置密码  */
  function subpwd(){
	  $.ajax({
			type:"post",
			url:"/bsc/user/resetpwd",
			data:{"idno":$("#idno").val(),"name":$("#name").val()},
			success:function(msg){
				alert(msg);
				if(msg=='y'){
					alert("重置成功！");
					returnlog();
				}else{
					alert("验证失败");
				}
			}
		});
  }
  var error=${error};
	if(error=='2'){
		alert("账号或密码错误");
	}
</script>
</body>
</html>